package util;

import java.util.ArrayList;
import java.util.List;

/**
 * @author GeChen
 * @Description 将String信息解析为List
 * @date 2019/5/8 14:06
 */
public class DecodeList {

    private String encodeString;
    private List<Double> list;

    public String getEncodeString() {
        return encodeString;
    }

    public void setEncodeString(String encodeString) {
        this.encodeString = encodeString;
    }

    public List<Double> getList() {
        return list;
    }

    public void setList(List<Double> list) {
        this.list = list;
    }

    public DecodeList(String encodeString) {
        this.encodeString = encodeString;
        this.list = new ArrayList<Double>();
    }
    //data:[166,120,92,107,150,186,181,140,100,96,131,176,188,159,113,93,115,159,188,174,131,96,102,140,181,184,149,105,93,123,168,188,165,121,94,108,151,186,180,139,100,97,132,176,188,157,112,92,116,162,189,174,135,105,102,138,178,182,147,105,94,124,169,189,166,120,93,109,151,186,179,138,99,97,133,177,187,156,110,91,115,161,188,173,129,96,103,143,183,185,147,105,94,125,170,189,165,119,93,108,152,187,179,138,98,97,133,177,188,157,111,92,116,162,189,172,133,104,103,138,178,181,145,104,94,125,171,189,164,119,93,109,153,186,178,137,98,98,134,178,187,156,111,93,117,163,189,172,128,96,103,143,183,183,145,103,94,126,171,189,164,118,93,110,154,187,178,135,98,97,135,179,188,156,110,93,118,163,189,171,132,105,105,141,179,180,143,103,95,127,172,189,163,118,94,111,155,187,177,135,98,99,136,179,188,155,110,93,118,164,189,171,127,95,104,145,183,182,145,104,96,128,173,189,163,118,94,112,155,187,177,135,98,100,137,179,187,154,110,93,119,165,189,170,131,104,105,142,180,180,143,103,96,129,174,190,163,117,93,112,156,188,178,135,98,100,137,179,186,153,109,93,119,165,189,170,125,95,105,147,184,182,143,102,96,129,174,189,162,116,93,112,156,187,176,134,97,99,137,180,186,152,108,93,120,166,190,170,130,104,106,143,180,179,142,102,97,130,174,189,162,116,94,113,158,188,176,133,97,100,139,180,186,152,108,94,122,167,190,169,124,94,106,148,185,182,142,101,96,130,174,189,160,114,92,112,158,189,176,132,95,99,139,183,188,152,106,91,121,168,191,170,127,101,106,146,183,181,140,99,95,131,177,191,160,113,91,113,159,190,176,132,96,101,140,182,186,150,106,94,122,168,189,168,123,95,108,149,184,179,140,102,98,131,173,185,158,114,95,116,158,185,172,132,100,104,140,178,182,149,109,98,124,166,185,165,128,106,110,143,176,172,138,104,101,132,171,182,156,116,98,117,156,182,170,132,102,106,140,175,179,147,110,99,125,164,182,163,124,100,112,148,179,174,139,106,103,133,170,181,155,116,99,118,157,181,169,132,103,107,141,175,178,148,112,101,126,164,182,163,129,111,114,144,174,170,137,105,104,134,171,180,155,116,100,119,158,181,169,132,103,108,141,175,177,147,111,102,127,165,182,161,123,100,114,150,180,174,139,106,104,134,170,180,155,117,100,120,159,181,168,131,102,108,142,176,178,147,111,102,127,166,182,162,128,110,114,146,175,170,137,105,105,135,171,180,154,116,100,120,159,181,168,130,103,109,142,176,177,146,110,102,127,165,181,161,122,101,114,151,179,173,138,106,105,135,171,179,153,116,100,121,159,181,167,130,102,109,143,176,177,146,110,102,128,166,181,159,126,109,115,147,176,170,136,106,105,136,172,179,153,115,100,121,159,181,166,129,102,110,143,177,177,145,110,102,129,168,182,161,122,101,115,151,180,172,138,106,106,136,173,180,153,116,101,122,161,182,167,129,102,110,144,177,176,144,110,103,129,168,182,160,126,109,116,148,175,168,135,105,106,137,173,179,151,113,100,121,160,181,167,129,103,111,144,177,175,143,108,102,130,169,183,160,121,99,115,153,179,171,136,105,106,138,174,180,152,114,101,123,161,181,165,127,102,110,145,178,176,143,108,102,129,167,181,159,124,109,117,149,176,168,135,105,106,137,173,179,151,113,100,123,161,181,165,127,101,111,146,178,176,143,108,103,130,168,182,159,120,100,116,154,181,171,135,104,106,138,173,179,151,114,101,124,162,181,164,126,100,110,146,177,175,143,108,103,131,169,181,158,124,109,117,150,176,167,133,103,106,138,174,179,150,113,101,124,162,182,165,127,102,112,147,179,176,142,107,102,130,168,180,157,118,100,118,155,181,171,134,104,107,139,174,179,150,113,102,125,163,181,164,126,101,112,147,178,175,142,108,104,132,169,181,157,123,109,118,151,176,166,131,103,106,139,173,178,149,112,101,125,164,181,164,126,101,112,147,178,175,141,107,103,132,170,181,157,118,101,119,157,181,170,133,104,108,141,176,179,148,112,101,124,163,181,163,125,101,112,148,179,175,141,107,104,133,170,181,157,123,110,119,151,176,166,131,103,108,141,175,178,148,112,102,126,165,182,163,125,102,113,149,179,174,140,106,104,133,170,181,156,118,100,119,158,181,169,132,103,108,141,175,177,147,112,102,127,165,182,163,124,101,113,149,179,174,140,107,105,134,171,181,156,122,110,120,152,176,165,130,103,109,142,176,178,147,111,102,127,166,182,163,124,102,114,150,179,174,139,106,104,134,171,180,154,116,100,120,158,181,168,131,103,109,142,176,178,147,111,101,127,165,182,161,123,101,114,150,178,172,138,106,105,135,171,180,154,120,109,120,154,176,164,129,102,109,143,176,177,146,110,102,127,165,181,160,123,101,114,151,179,172,138,106,105,135,171,179,153,116,100,120,159,181,167,130,102,109,143,176,177,146,110,103,128,167,182,161,123,101,115,151,179,172,137,105,105,135,172,179,152,120,110,122,155,176,163,128,102,109,143,176,177,145,110,102,128,166,181,159,122,101,115,151,179,172,137,106,106,136,172,179,152,115,101,122,160,181,166,129,102,110,144,177,176,145,109,102,129,167,181,159,121,101,116,152,179,171,136,105,106,137,172,179,151,119,110,123,156,176,162,126,101,110,144,177,176,143,109,103,129,167,180,159,120,100,115,152,179,171,136,105,106,137,173,179,152,115,101,122,160,181,165,128,102,111,146,178,176,143,109,102,129,167,180,158,120,100,116,153,179,170,135,104,106,137,173,179,151,118,109,123,157,176,162,126,101,111,145,177,175,143,108,103,130,168,181,159,120,101,117,154,180,170,135,105,106,138,174,179,151,114,101,123,162,182,165,128,103,112,146,178,176,143,108,103,131,168,180,158,120,101,118,155,180,171,135,104,107,138,174,179,150,118,111,125,158,177,161,125,101,112,147,178,175,142,108,103,131,170,181,158,119,100,117,155,180,170,134,104,107,139,174,178,149,112,101,125,163,182,164,126,101,112,147,178,175,142,108,104,132,169,181,157,119,101,118,156,181,170,134,104,107,139,174,178,148,116,110,125,159,177,160,123,100,112,148,179,175,140,107,103,132,169,180,156,118,100,118,156,180,169,133,104,107,139,174,178,148,112,101,125,163,181,163,125,101,113,148,178,174,141,107,103,132,169,180,155,117,100,119,156,180,168,132,103,107,140,175,178,148,117,111,126,159,176,159,123,101,113,149,179,173,139,106,104,133,170,181,157,119,102,120,158,181,169,132,103,108,141,175,177,147,111,101,127,165,182,163,125,101,114,149,179,174,139,107,105,134,170,180,155,117,101,119,158,181,169,132,104,108,141,176,178,148,116,111,127,160,176,158,122,100,113,149,179,173,139,106,104,134,171,180,154,116,100,119,158,181,168,131,103,109,141,175,177,146,111,102,127,165,181,162,123,100,113,149,178,173,139,107,105,134,171,180,154,116,100,120,158,180,167,130,103,109,142,176,177,146,115,111,128,161,177,158,121,101,114,150,179,172,137,105,105,135,172,180,154,116,100,120,159,181,167,131,103,109,143,176,177,146,111,102,128,166,181,161,123,101,115,151,179,172,137,105,105,135,172,180,153,116,101,121,159,181,167,130,103,110,143,176,176,145,114,111,129,162,177,158,121,101,115,151,180,172,137,105,105,136,172,180,153,116,101,122,159,181,166,129,103,110,144,177,178,146,111,103,130,168,182,161,123,102,116,152,180,173,138,106,107,137,173,179,152,115,101,122,161,182,167,130,103,110,144,177,177,145,114,112,130,163,176,156,120,100,116,153,180,172,136,105,106,137,173,179,152,114,101,122,161,181,166,128,102,110,143,176,175,143,108,101,128,167,181,159,120,100,116,152,179,170,135,104,106,137,172,179,151,114,100,122,160,181,165,128,102,111,145,177,176,144,114,113,131,164,176,156,119,100,116,153,180,171,135,104,106,137,173,179,151,114,101,123,161,181,165,128,102,112,146,178,175,143,108,103,131,169,182,159,120,100,117,154,180,171,136,105,107,138,174,179,150,113,101,124,162,181,164,127,102,112,146,178,175,142,112,111,131,163,176,154,118,100,117,155,181,171,135,104,107,139,174,178,150,113,101,123,161,180,164,126,102,112,147,178,175,142,108,103,131,169,181,158,119,101,118,156,181,171,135,104,107,138,173,178,149,112,101,124,163,181,163,125,101,112,147,178,174,141,112,112,131,164,175,153,117,100,118,156,181,171,134,105,109,141,175,179,150,113,101,125,164,182,165,127,103,113,148,178,175,141,107,103,132,169,181,157,118,101,119,157,181,169,133,104,109,141,175,179,149,112,102,125,164,181,163,125,101,112,148,179,175,141,112,113,134,166,176,153,116,99,118,156,181,169,132,103,108,141,175,178,148,111,101,125,163,181,163,125,102,114,150,179,174,140,107,104,134,171,181,156,118,101,120,158,181,169,132,103,108,140,175,178,148,111,101,126,164,181,162,124,101,113,149,179,174,140,111,113,133,165,175,152,116,100,119,157,180,168,132,103,108,141,175,177,147,111,101,126,164,181,162,124,101,113,149,178,173,138,106,104,134,171,181,156,117,101,120,158,181,168,131,103,109,143,177,179,148,112,103,128,166,182,162,124,101,115,151,179,174,139,111,114,135,166,175,150,114,100,120,159,181,168,131,104,110,143,177,178,147,111,102,128,166,183,162,124,101,114,150,179,173,138,106,104,135,172,180,154,116,100,120,158,180,167,130,103,109,143,176,177,146,111,102,128,166,182,162,123,102,115,151,179,172,138,110,114,135,166,175,149,114,100,121,159,182,167,130,102,109,143,176,176,145,110,102,128,166,181,160,122,101,115,151,179,171,136,104,104,135,171,179,153,115,100,121,159,181,167,130,103,110,143,176,176,145,110,102,129,167,181,159,121,100,115,151,178,171,135,109,114,136,168,174,148,113,100,122,161,182,167,129,102,110,143,176,175,143,109,102,128,167,181,159,121,100,115,152,179,171,136,104,105,136,172,179,151,114,101,123,161,182,166,128,102,110,144,176,176,143,109,102,129,167,180,158,120,100,115,152,179,171,136,109,115,137,168,174,147,112,100,123,161,181,165,128,102,111,144,176,175,143,109,102,129,167,181,159,120,100,117,154,181,171,135,105,106,137,173,179,151,114,101,123,161,182,165,128,102,111,145,177,176,143,109,103,131,169,182,159,120,101,117,154,180,171,135,109,115,138,169,174,147,112,101,124,163,182,165,128,102,111,146,178,175,143,109,104,131,169,182,159,120,100,117,154,179,170,134,105,107,139,174,179,150,113,100,124,163,182,165,127,102,111,146,178,175,142,108,103,131,169,181,158,119,100,117,155,180,170,134,108,115,139,169,173,146,112,101,125,163,182,164,126,102,112,147,178,175,142,109,105,132,169,181,157,119,101,119,157,181,171,134,105,107,139,174,178,149,112,101,125,164,182,163,125,101,111,147,177,174,141,108,104,132,170,181,157,118,100,119,156,180,169,134,108,116,140,170,173,145,110,101,125,164,182,163,125,101,112,148,178,174,140,107,103,132,169,180,157,118,101,119,156,180,169,132,103,108,140,174,177,147,111,100,125,163,181,163,125,101,112,148,178,174,140,107,104,133,170,181,156,118,101,119,157,180,169,132,108,117,141,170,173,145,111,102,127,165,182,163,124,101,113,149,179,174,141,107,105,134,171,180,155,117,100,119,157,180,168,131,103,108,141,175,177,147,111,102,127,165,182,162,124,101,113,149,178,173,139,106,104,133,170,179,154,116,100,119,158,181,168,131,107,117,141,171,172,143,110,102,127,166,182,162,123,100,113,149,178,173,139,106,104,134,171,180,154,116,100,120,159,182,168,131,103,109,142,175,177,146,111,102,128,166,181,161,123,101,114,151,179,174,139,106,105,134,171,179,153,116,100,121,159,181,167,130,107,118,143,171,171,142,109,101,128,166,181,161,123,101,114,150,179,172,138,106,105,135,172,180,154,116,101,121,159,181,167,130,103,110,143,177,177,146,110,102,128,166,181,160,122,101,114,150,179,172,137,106,105,135,172,180,153,116,101,122,160,182,168,131,107,119,145,173,173,142,109,102,129,167,182,161,122,101,116,152,180,172,137,105,106,137,173,180,153,116,101,122,159,180,166,129,102,110,144,177,177,145,110,102,128,166,181,159,120,100,115,152,180,172,136,105,105,136,171,179,151,114,101,122,161,182,167,129,107,119,145,172,171,141,108,103,130,168,182,160,121,101,116,153,180,172,136,105,106,137,173,179,151,114,100,122,161,181,165,128,102,110,145,177,176,143,109,103,130,168,181,159,120,100,116,153,180,172,136,105,106,137,173,179,151,114,101,124,163,183,167,129,107,120,146,172,171,141,108,102,130,168,181,158,120,100,116,153,179,171,135,104,106,138,172,178,151,114,102,124,162,181,165,128,102,111,145,177,175,143,109,103,131,169,181,159,120,101,117,154,180,171,135,105,107,138,174,179,151,114,101,124,162,181,164,127,106,121,147,173,171,139,107,103,131,169,181,158,119,100,117,155,181,171,135,104,107,139,174,179,150,114,102,124,162,181,164,126,101,112,147,178,175,143,109,104,132,170,182,158,120,101,118,155,179,169,133,104,108,140,175,179,150,113,102,125,163,182,165,127,106,121,148,174,170,138,107,103,132,169,181,157,119,101,119,156,180,169,133,104,107,140,174,178,149,113,102,125,163,182,164,126,102,113,147,178,174,141,107,104,132,169,180,156,118,101,119,156,180,169,133,104,108,141,175,178,149,112,102,125,163,181,163,125,106,122,149,174,170,138,106,103,132,169,180,156,118,100,119,156,179,168,132,103,108,140,174,177,148,112,102,125,163,180,163,125,102,113,148,178,174,140,107,104,133,170,180,155,117,100,119,157,180,168,132,103,108,140,174,177,147,111,102,127,165,181,162,125,106,122,149,173,169,137,106,104,134,170,180,155,117,101,120,157,180,167,131,103,108,141,176,178,148,112,103,128,166,182,162,124,101,114,149,179,173,139,107,105,134,170,179,154,116,100,119,158,180,167,131,103,109,142,175,176,146,111,102,127,165,180,161,123,105,123,151,174,168,136,105,105,135,171,180,154,116,101,120,159,181,167,130,102,108,142,175,177,146,110,102,127,165,181,161,123,101,114,150,179,172,138,107,105,135,171,179,153,116,101,121,159,181,168,131,104,110,143,176,177,146,111,102,128,166,181,161,122,105,124,152,175,167,134,104,105,135,172,180,154,117,102,122,160,182,167,130,103,110,143,176,176,145,110,102,129,167,182,161,122,101,115,151,179,172,137,106,106,136,173,180,153,115,100,121,159,181,167,130,103,110,144,177,177,145,110,102,128,167,181,159,121,104,124,153,175,167,134,103,105,136,173,180,152,115,100,121,159,181,166,128,102,110,144,177,177,145,110,103,129,167,181,159,121,100,115,152,180,172,137,105,106,137,173,179,152,114,100,122,160,181,166,128,102,110,144,177,176,143,109,102,129,167,181,159,121,105,125,155,176,167,133,103,105,137,174,180,152,114,101,122,161,180,165,127,102,111,145,177,176,143,109,103,130,168,181,159,121,101,116,153,180,171,135,105,107,138,174,179,151,113,100,122,161,181,165,127,102,111,146,178,176,143,109,103,131,168,181,159,120,104,126,155,176,166,132,103,106,138,174,180,151,113,101,124,163,182,165,127,102,111,146,178,175,142,108,102,130,169,181,159,120,100,117,154,180,171,134,104,107,139,174,179,150,113,100,123,162,182,165,127,101,111,146,177,174,141,107,103,131,170,182,159,119,104,126,155,175,165,131,103,107,140,175,179,150,114,101,124,162,181,164,127,102,112,147,179,175,142,108,103,131,169,181,158,120,101,118,155,180,170,134,104,107,139,174,178,149,112,101,124,163,181,163,125,101,111,147,178,175,141,108,104,132,170,181,157,119,104,127,157,176,166,131,103,108,140,175,178,149,112,102,126,164,182,164,126,102,113,148,179,175,142,108,104,133,170,181,156,117,100,118,156,180,169,132,103,107,140,175,178,148,112,101,125,163,181,163,125,101,113,148,178,174,141,107,104,132,169,180,155,117,104,127,158,176,164,129,102,107,141,175,177,147,111,100,125,164,181,162,124,100,112,148,178,173,139,106,103,132,170,180,156,117,100,120,158,180,168,131,103,108,141,175,178,147,111,101,126,164,181,162,123,100,113,149,179,174,140,107,104,133,170,180,155,117,104,128,159,176,163,128,101,107,141,175,177,147,111,101,126,165,182,162,123,100,113,149,178,173,139,106,104,134,171,180,154,116,100,120,158,181,168,131,103,108,141,175,176,145,110,102,127,165,182,162,123,101,114,150,179,174,139,106,104,134,170,179,154,117,105,130,159,176,163,127,101,109,142,175,176,145,109,101,127,165,181,161,122,101,114,150,179,173,138,106,105,135,171,179,153,115,100,120,159,182,168,131,103,110,143,176,177,145,110,101,127,166,181,160,122,100,113,150,178,172,138,107,105,135,171,180,153,115,104,130,160,177,162,127,101,109,143,177,177,146,110,102,128,166,182,161,123,101,115,151,179,172,137,106,105,136,172,180,153,116,101,122,160,182,167,129,103,110,143,177,177,145,110,102,128,166,181,160,122,101,116,152,180,172,137,106,106,136,173,180,153,115,104,130,160,176,161,126,101,109,143,176,176,145,109,102,128,166,180,159,122,101,116,153,180,172,137,106,106,137,173,179,152,115,100,122,160,182,167,129,103,111,145,177,176,143,109,102,128,167,182,160,121,101,116,152,179,171,136,105,106,137,173,179,151,114,104,131,162,176,160,125,100,109,145,177,176,143,109,102,129,167,181,159,121,100,116,153,179,171,135,104,105,136,172,178,151,113,100,123,161,182,166,128,102,111,145,177,176,143,109,103,130,168,182,159,121,101,116,153,180,171,135,105,107,138,173,179,151,113,104,132,163,177,161,125,101,111,145,177,176,143,108,103,130,168,181,159,120,101,117,154,180,172,136,105,106,138,173,179,150,113,101,123,161,181,164,127,102,111,146,178,176,143,109,104,131,169,181,158,119,100,117,154,180,170,134,104,107,138,173,179,150,113,105,132,162,177,159,124,101,111,146,178,176,143,108,103,130,168,181,158,119,100,116,154,180,170,135,105,107,139,174,179,150,112,100,123,162,182,165,127,102,111,146,177,175,143,108,103,131,168,181,157,119,100,118,155,180,170,134,104,106,138,174,179,150,112,104,132,163,177,159,123,100,112,147,178,175,141,107,102,131,168,180,156,118,100,117,155,180,169,133,103,106,139,174,179,149,113,101,125,163,182,164,126,102,112,147,178,174,141,108,104,132,170,181,158,119,100,118,156,180,169,133,104,107,140,175,179,149,112,105,133,164,177,159,122,100,111,147,178,174,141,107,103,132,169,181,156,118,101,119,157,181,169,133,104,108,141,175,179,149,113,102,126,164,182,163,125,101,113,148,179,175,141,108,105,134,170,180,156,117,100,119,157,181,169,133,104,108,141,175,179,149,113,106,135,165,177,159,122,101,113,149,179,175,141,106,103,132,169,180,156,118,101,119,157,181,169,133,104,108,140,174,178,148,112,102,126,165,182,163,125,102,114,148,178,173,140,107,104,134,171,181,156,117,100,119,158,181,169,133,104,108,141,175,178,148,111,105,134,165,176,157,120,100,114,150,180,175,141,107,104,133,170,180,155,117,100,120,158,181,168,132,104,109,142,176,179,148,111,102,126,165,182,163,124,101,113,149,179,174,139,107,105,134,170,180,155,117,101,120,158,181,168,131,103,108,141,175,178,147,111,105,135,165,177,157,120,99,114,150,179,173,138,105,104,133,170,180,155,117,100,120,158,181,168,131,103,109,141,175,177,146,111,102,127,165,182,161,123,101,115,151,179,173,139,106,104,134,170,179,154,116,100,120,159,181,168,131,103,109,142,175,176,146,110,105,135,166,177,156,120,100,114,150,178,172,138,106,105,135,171,179,154,116,100,121,159,181,168,130,103,109,143,176,177,146,110,101,127,165,182,161,123,101,115,151,179,173,139,106,105,135,172,180,154,116,100,120,159,181,168,131,103,109,143,176,177,146,111,107,137,167,177,156,120,100,115,151,180,173,138,106,106,136,173,181,154,116,101,121,159,181,167,130,103,110,143,176,177,146,110,102,127,166,182,161,122,100,114,151,179,172,137,106,105,135,171,180,153,116,100,121,159,181,167,130,103,110,143,176,176,144,109,105,136,167,176,155,119,100,115,152,180,172,138,106,106,136,172,180,154,115,100,120,159,181,167,129,103,110,143,177,177,145,110,102,129,167,182,160,122,101,115,152,180,172,137,105,105,136,172,180,153,115,100,121,160,182,167,129,102,110,143,177,177,145,110,106,137,169,177,155,118,99,115,151,179,171,136,105,106,136,172,179,152,114,100,122,160,182,167,130,103,110,143,176,176,143,108,101,128,166,181,159,121,101,115,152,179,171,136,105,105,137,173,180,152,114,101,122,160,181,166,129,103,111,145,178,177,145,110,106,137,168,177,155,118,99,116,153,181,172,137,106,106,137,172,179,151,114,101,123,161,182,166,129,102,110,144,177,176,143,110,104,130,168,181,159,121,101,117,154,180,171,136,105,106,138,173,179,151,114,100,122,160,181,165,128,102,110,144,176,175,143,109,106,139,169,177,154,117,98,116,153,180,171,136,105,107,138,174,180,152,115,102,123,161,180,164,127,102,111,145,177,175,143,108,102,130,168,181,159,119,99,116,153,180,171,135,104,106,137,173,179,151,114,101,122,161,181,165,128,102,111,146,177,176,143,109,107,139,169,177,154,117,99,116,153,180,171,135,104,106,138,174,179,151,114,101,123,161,181,164,127,102,111,146,177,175,142,108,103,130,169,182,159,121,101,117,154,180,171,135,104,106,138,173,179,151,114,101,123,161,181,164,127,102,112,147,178,176,143,109,107,140,170,177,153,116,99,117,155,181,171,135,105,108,139,174,180,151,114,101,124,162,182,165,128,102,111,146,177,175,142,108,104,131,169,181,159,120,101,118,155,181,171,135,104,106,138,173,179,151,114,102,124,163,181,164,126,101,111,147,177,175,142,108,107,140,171,177,153,116,99,118,155,181,170,135,104,106,138,174,179,151,113,101,124,163,182,164,127,103,112,147,178,175,142,107,103,131,169,181,158,119,100,117,155,180,170,134,104,106,138,173,178,149,113,101,124,163,181,164,126,101,112,147,178,174,141,108,107,140,171,177,152,115,99,117,156,181,171,134,104,107,139,174,178,149,112,101,125,163,181,163,125,101,112,147,179,176,142,107,103,131,169,181,158,120,101,119,156,181,170,134,104,107,139,175,179,150,113,102,125,163,182,163,126,102,113,147,178,175,142,108,107,140,170,176,151,115,99,118,156,180,169,133]
    public  List<Double> String2List(){
        double temp = 0;
        for(int i = 0;i < encodeString.length();i++){
            if(encodeString.charAt(i) == '[') continue;
            while(encodeString.charAt(i) >= '0' && encodeString.charAt(i) <= '9'){
                temp = temp * 10 + (encodeString.charAt(i)-48);
                i++;
            }
            list.add(temp);
            temp = 0;
        }
        return list;
    }

    public double getECG(List<Double> datas){

        if(datas.size() < 5000)
            return -1.0;

        double sum = 0;
        for(double temp:datas){
            sum += temp;
        }
        double avg = sum / datas.size();

        double ECG = 0;

        List<Integer> maxIndex = new ArrayList<Integer>();
//        for(int i = 0;i < 1000;i ++){
//            if(datas.get(i) - avg >= 20)
//                a1 = i;
//        }
//        for (int i = a1+1; i < 1000;i++){
//            if(datas.get(i) - avg >= 20)
//                a2 = i;
//        }
//        ECG1 = (a2 - a1) * 0.2;
//
//        for(int i = 1001;i < 3000;i ++){
//            if(datas.get(i) - avg >= 20)
//                a1 = i;
//        }
//        for (int i = a1+1; i < 3000;i++){
//            if(datas.get(i) - avg >= 20)
//                a2 = i;
//        }
//        ECG2 = (a2 - a1) * 0.2;
//
//        for(int i = 2000;i < 5000;i ++){
//            if(datas.get(i) - avg >= 20)
//                a1 = i;
//        }
//        for (int i = a1+1; i < 5000;i++){
//            if(datas.get(i) - avg >= 20)
//                a2 = i;
//        }
//        ECG3 = (a2 - a1) * 0.2;
        for (int i = 0;i < datas.size();i++){
            if(datas.get(i) - avg >= 20 && datas.get(i) > datas.get(i-1) && datas.get(i) < datas.get(i+1))
                maxIndex.add(i);
        }

        if(maxIndex.size() < 2){
            return -1;
        }else if(maxIndex.size() == 2){
            return (maxIndex.get(1) - maxIndex.get(0) - 1) * 0.2;
        }else {
            for(int i = 0;i < maxIndex.size()-1;i ++){
                int a0 = maxIndex.get(i);
                int a1 = maxIndex.get(i+1);
                ECG += (a1 - a0 - 1) * 0.2;
            }
            return ECG/(maxIndex.size() - 1);
        }
    }
}
